<!DOCTYPE html>
<html lang="zh_CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <a href="webapis.html">点我进api</a>
    <button>后退</button>
    <script>
        let btb = document.querySelector('button')
        btb.addEventListener('click', function() {
            // history.back();
            history.go(-1);
        });
        /* 单行注释CTRL+/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                多行注释ALT+SHIFT+a */

        /* prompt('请输入年龄');
        alert('计算结果');
        console.log('There is baizhi958216'); */

        /* var age;
        age = 10;
        var shenzi = '八重卢子'
        console.log(age);
        console.log(shenzi); */

        /* var myname = '神里七华';
        var attribute = '冰';
        var arms = '单手剑';
        var gender = '女';
        var describe = '是个僵尸';
        console.log(myname);
        console.log(attribute);
        console.log(arms);
        console.log(gender);
        console.log(describe); */

        /* var yourname = prompt('请输入你的名字');
        alert(yourname); */

        /* var ageone = 18;
        console.log(ageone);
        ageone = 20;
        console.log(ageone);
        var myname = '神里七华',
            attribute = '冰',
            arms = '单手剑',
            gender = '女',
            describe = '是个僵尸';
        var sex;
        console.log(sex);
        // console.log(agetwo);
        agethree=21;
        console.log(agethree); */

        /* var Hello = 'hi';
        var hello = 'hi hi hi';
        console.log(Hello);
        console.log(hello);
        // var var = 1;
        var $hi,_hi,myFirstName;
        console.log(name); */

        /* var redApple = '红苹果';
        var cyanApple = '青苹果';
        var temp;
        temp = cyanApple;
        cyanApple = redApple;
        redApple = temp;
        console.log(redApple);
        console.log(cyanApple); */

        /* var num = 10;
        console.log(typeof(num));
        num = '动态数据类型';
        console.log(typeof(num)); */

        /* var a1=1,
            a2=1.2,
            a3=true,
            a4='a4',
            a5="a5",
            a6;
        console.log(typeof(a1));
        console.log(typeof(a2));
        console.log(typeof(a3));
        console.log(typeof(a4));
        console.log(typeof(a5));
        console.log(isNaN('a5'));
        console.log(typeof(a6));
        var a7 = 010;//前加0表示八进制
        console.log(a7)
        var a8 = 0xa;//前加0x表示十六进制
        console.log(a8);
        console.log(Number.MAX_VALUE);//1.7976931348623157e+308
        console.log(Number.MIN_VALUE);//5e-324
        console.log(Number.MAX_VALUE*2);//无穷大Infinity
        console.log(-Number.MAX_VALUE*2);//无穷小-Infinity */

        // alert('我的旧友啊，因为没办法边吃甜点心边看小说，\n气的内心崩溃,又哭又闹，\n呜呜呜呜，好可怜啊~');

        /* var strLeng = 'abcdefgh';
        console.log(strLeng.length);
        console.log('八重'+'神子'+1+strLeng.length);
        console.log('八重'+'神子'+true);
        console.log(123+456);
        console.log('123'+456); */

        // 交互编程三要素：用户输入，程序内部处理，输出结果
        /* var _age1 = prompt('你的年龄：');
        var strage = '你今年'+_age1+'岁了'
        alert(strage); */

        /* var flag1 = true;
        var flag2 = false;
        console.log(flag1+1);
        console.log(flag2+1);
        // undefined
        var variable;
        console.log(variable);
        console.log(variable+'hello');//undefinedhello
        console.log(variable+1);//NAN
        // null
        var nullvar = null;
        console.log(nullvar);//null
        console.log(nullvar+1);//1 */

        /* var num10 = 10;
        console.log(typeof(num10.toString()));
        console.log(typeof(String(num10)));
        console.log(typeof(num10+'')); */

        /* console.log(typeof(parseInt('114514')));
        console.log(typeof(parseFloat('114.514')));
        console.log(typeof(Number('114514')));
        var strInt = parseInt('123456num');
        console.log(strInt);
        console.log(strInt-0);
        console.log(strInt*1);
        console.log(strInt/1); */

        /* var jianum1 = prompt('请输入第一个数:');
        var jianum2 =prompt('请输入第二个数:');
        var resultnums = Number(jianum1)+Number(jianum2);
        alert('计算结果为:'+resultnums); */

        /* console.log(Boolean(1));//true
        console.log(Boolean('012345'));//true
        console.log(Boolean(0));//false
        console.log(Boolean(''));//false
        console.log(Boolean(undefined));//false
        console.log(Boolean(NaN));//false
        console.log(Boolean(null));//false */

        //标识符：开发人员定义的变量、属性、函数、参数名
        //关键字：已经被JS使用了的，如if else catch break do while
        //保留字：未来可能会成为关键字的，具体ECMA提案

        // 算数运算符+ - * / %(取余)
        /* console.log(3%5);
        console.log(0.1+0.2);//0.30000000000000004
        console.log(0.1+0.2==0.3);//false 不要直接用浮点数进行比较
        console.log(0.55*100);//55.00000000000001 */
        /* var fuckpp = 1;
        ++fuckpp;//2
        var fuckppp2 = fuckpp++ + 2;//2+2
        console.log(fuckppp2);//fuckpp = 3
        var fuckppp1 = ++fuckpp + 2;//4+2
        console.log(fuckppp1);
        console.log(fuckpp);//4

        var fuckppe = 10;
        var fuckppf = fuckppe++ + ++fuckppe;
        //先fuckppe++，fuckpp++ = 10，fuckpp = 11
        //再++fuckpp，++fuckpp = 12，fuckpp = 12
        //10 + 12 = 22
        console.log(fuckppf);//22
        console.log(fuckppe); //12*/

        /* console.log(3>=5);//false
        console.log(2<=4);//true
        console.log(3==5);//false
        console.log('abcderf'=='hijklmn');//false
        console.log(18==18);//true
        console.log(18=='18');//true
        console.log(18==='18');//false
        console.log(18!='18');//false
        console.log(18!=='18')//true
        //逻辑与 &&，有一个假则false
        console.log(3>5&&3>2);//false
        console.log(3>5&&3<2);//false
        console.log(3<5&&3>2);//true
        //逻辑或 ||，有一个真则true
        console.log(3>5||3>2);//true
        console.log(3<5||3>2);//true
        console.log(3>5||3<2);//false
        //逻辑非 !，结果相反
        console.log(!(3<5||3>2));//false
        //逻辑与的短路运算，表达式1为真则返回表达式2，表达式1为假就返回表达式1
        //0 '' null undefined NaN
        console.log(123&&456&&789);//789
        console.log(123&&''&&789);//789
        console.log(0&&123+456&&789&&54578);//0
        //逻辑或的短路运算，表达式1为真则返回表达式1，表达式1为假就返回表达式2
        console.log(123||456);
        var dsdaaaa= 0;
        console.log(123||dsdaaaa++);
        console.log(dsdaaaa); */

        /* //+= -= *= /= %=
        var numps = 10;
        numps+=20;//numps = numps + 20;
        console.log(numps); 
        console.log( 4<=6 || 'a'=='b' && !(10*2==120) && true);
        //4<=6 true
        //'a'=='b' false
        //!(10*2==120) true 
        //先&&，则 true||false,所以true*/

        /* var ifage = prompt('输入年龄：');
        if(ifage >= 18)
        {
            alert('我带你去网吧');
        }else{
            alert('回家自己玩');
        } */

        /* var isRun = prompt('输入年份：');
        if(isRun%4==0&&isRun%100!=0||isRun%400==0){
            alert('闰年');
        }else{
            alert('平年');
        } */

        /* var isLiuDeHua = prompt('输入姓名：');
        if(isLiuDeHua=='刘德华'){
            alert('你不是刘德华');
        }else{
            alert('你是'+isLiuDeHua);
        } */

        /* var chengji = prompt('输入你的成绩： ');
         
        if(chengji>=90){
            alert('A');
        }else if(chengji>=80){
            alert('B');
        }else if(chengji>=70){
            alert('C');
        }else if(chengji>=60){
            alert('D');
        }else if(chengji>=0){
            alert('E');
        }else{
            alert('请输入成绩哦！');
        }
        //三元表达式 条件表达式?表达式1:表达式2
        var timett = prompt('输入数字：');
        var result = timett>=10?timett:'0'+timett;
        alert(result); */

        /* var fruit = prompt('输入水果名称:');
        switch (fruit) {
            case '苹果':
                alert('10元一斤');
                break;
            case '香蕉':
                alert('20元一斤');
                break;
            default:
                console.log('查询不到此水果');
        } */

        /* var forff = parseFloat(prompt('输入吧'));
        for (var a = 1; a <= forff; a++) {
            if (a == 1) {
                console.log('出生了');
            } else if (a == 100) {
                console.log('死了');
            } else {
                console.log('今年' + a + '岁了')
            }
        }
        var sumadd = 0;
        for (var a = 1; a <= 100; a++) {
            sumadd += a;
        }
        console.log(sumadd);
        var tmpaver = 0;
        var sumadd1 = 0;
        for (var a = 1; a <= 100; a++) {
            sumadd1 += a;
        }
        tmpaver = sumadd1 / 100;
        console.log(tmpaver);
        var ji = 0;
        var ou = 0;
        for (var a = 1; a <= 100; a++) {
            if (a % 2 == 0) {
                ou += a;
            } else {
                ji += a;
            }
        }
        console.log('1-100奇数和为' + ji);
        console.log('1-100偶数和为' + ou);
        var threeall = 0;
        for (var a = 1; a <= 100; a++) {
            if (a % 3 == 0) {
                threeall += a;
            }
        }
        console.log('1-100能被3整除的数的和为' + threeall);
        var classments = parseFloat(prompt('输入人数和：'));
        var classmentssum = 0;
        for (var a = 1; a <= classments; a++) {
            classmentssum += parseFloat(prompt('输入第' + a + '个同学成绩'));
        }
        alert('总成绩为' + classmentssum);
        alert('平均成绩为' + classmentssum / classments); */

        /* var strstar = '';
        for (var a = 1; a <= 5; a++) {
            for (var b = 1; b <= 5; b++) {
                strstar += '*';
            }
            strstar += '\n';
        }
        console.log(strstar);
        var strstard = '';
        for (var a = 1; a <= 5; a++) {
            for (var b = a; b <= 5; b++) {
                strstard += '*';
            }
            strstard += '\n';
        }
        console.log(strstard);
        var str99 = '';
        for (var i = 1; i <= 9; i++) {
            for (var j = 1; j <= i; j++) {
                str99 += j + 'x' + i + '=' + i * j + '\t'
            }
            str99 += '\n'
        }
        console.log(str99); */

        /* var whilei = 1;
        while (whilei < 100) {
            console.log('今年' + whilei + '岁');
            whilei++;
        }
        var whilej = 1;
        do {
            console.log('今年' + whilej + '岁');
            whilej++;
        } while (whilej < 100);

        var whilesum = 0;
        var whilea = 1;
        do {
            whilesum += whilea;
            whilea++;
        } while (whilea <= 100);
        console.log(whilesum);

        do {
            var whilemessage = prompt('你好吗？')
        } while (whilemessage !== '好');
        alert('我也好'); */

        /* for (var a = 1; a <= 7; a++) {
            if (a == 3) {
                continue;
            }
            console.log('继续' + a)
        }

        var sum = 0;
        for (var a = 1; a <= 100; a++) {
            if (a % 7 == 0) {
                continue;
            }
            sum += a;
        }
        console.log(sum);

        for (var a = 1; a <= 7; a++) {
            if (a == 3) {
                break;
            }
            console.log('继续' + a)
        } */

        /* var arrarr = new Array();
        var arrarr1 = [
            '星期一',
            '星期二',
            '星期三',
            '星期四',
            '星期五',
            '星期六',
            '星期日'
        ];
        console.log(arrarr);
        for (var a = 0; a < arrarr1.length; a++) {
            console.log(arrarr1[a]);
        }
        var arrsum = [2, 6, 1, 7, 4, 10, 11, 47, 56, 12, 45, 78, 115, 68, 0, 41, 45, 88, 4, 55, 7];
        var sumarr = 0;
        var tmparr = arrsum[0];
        var arrstr = '';
        for (var a = 0; a < arrsum.length; a++) {
            arrstr += arrsum[a] + '|';
            sumarr += arrsum[a];
        }
        console.log(arrstr);
        console.log('和为' + sumarr + '平均值为' + sumarr / arrsum.length);
        for (var a = 1; a < arrsum.length; a++) {
            if (arrsum[a] > tmparr) {
                tmparr = arrsum[a];
                // console.log(tmparr);
            }
        }
        console.log(tmparr);
        arrsum.length = arrsum.length + 5;
        console.log(arrsum);
        arrsum[0] = '你好';
        arrsum[arrsum.length - 1] = '你好吗';
        console.log(arrsum);
        console.log(arrsum[0]);
        for (var a = 0; a < 20; a++) {
            arrarr[a] = a + 1;
        }
        console.log(arrarr); */

        /* var arrsai = [2, 0, 6, 1, 77, 0, 52, 0, 25, 7];
        var newArrsai = [];
        for (var a = 0; a < arrsai.length; a++) {
            if (arrsai[a] >= 10) {
                newArrsai[newArrsai.length] = arrsai[a];
            }
        }
        console.log(newArrsai);
        var arrdel = [2, 0, 6, 1, 77, 0, 52, 0, 25, 7];
        var arrAfterdel = [];
        for (var a = 0; a < arrsai.length; a++) {
            if (arrdel[a] != 0) {
                arrAfterdel[arrAfterdel.length] = arrdel[a];
            }
        }
        console.log(arrAfterdel);
        var arrF = ['red', 'green', 'blue', 'pink', 'purple'];
        var affAf = [];
        for (var a = arrF.length - 1; a >= 0; a--) {
            affAf[affAf.length] = arrF[a];
        }
        console.log(affAf); */

        /* var chaa = 1;
        var chab = 2;
        var chatmp;
        chatmp = chaa;
        chaa = chab;
        chab = chatmp;
        console.log(chaa + ' ' + chab); */

        /* var mpArr = [1, 5, 3, 8, 2, 6, 9];
        var mptmp = 0;
        for (var a = 0; a <= mpArr.length - 1; a++) {
            for (var b = 0; b <= mpArr.length - a - 1; b++) {
                if (mpArr[b] > mpArr[b + 1]) {
                    mptmp = mpArr[b];
                    mpArr[b] = mpArr[b + 1];
                    mpArr[b + 1] = mptmp;
                }
            }
        }
        console.log(mpArr); */

        /* function sumaddd(num1, num2) {
            var numsum = 0;
            for (var a = num1; a <= num2; a++) {
                numsum += a;
            }
            return numsum;
        }
        console.log(sumaddd(1, 99499));

        function getReturn(something) {
            return something;
        }
        console.log(getReturn('一些东西'));

        function getMax(num1, num2) {
            return num1 > num2 ? num1 : num2;
        }
        console.log(getMax(1, 4));

        function getArrMax(arr) {
            var tmp = arr[0];
            for (var a = 1; a <= arr.length; a++) {
                if (tmp < arr[a]) {
                    tmp = arr[a];
                }
            }
            return tmp;
        }
        var mmx = getArrMax([5, 2, 99, 101, 67, 77])
        console.log(mmx);

        function argumentsUse() {
            console.log(arguments + ' ' + arguments.length + ' ' + arguments[1]);
            for (var a = 0; a < arguments.length; a++) {
                console.log(arguments[a]);
            }
        }
        argumentsUse(1, 2, 3, 4, 5, 8, 7, 45, 41547, 74, 7, 8, 786, 45, 4, 45); */
        /* function getMaxNum() {
            var max = arguments[0];
            for (var a = 1; a < arguments.length; a++) {
                if (max < arguments[a]) {
                    max = arguments[a];
                }
            }
            return max;
        }
        console.log(getMaxNum(1, 2, 1025, 4, 5, 6)); */
        /* function arrFun1(arr) {
            var result = [];
            for (var a = arr.length - 1; a >= 0; a--) {
                result[result.length] = arr[a];
            }
            return result;
        }
        var arr1 = arrFun1(['A', 'B', 'C', 'D', 'E', 'F'])
        console.log(arr1) */
        /* function arrMao(arr) {
            var tmp
            for (var a = 0; a < arr.length - 1; a++) {
                for (var b = 0; b < arr.length - 1 - a; b++) {
                    if (arr[b] > arr[b] + 1) {
                        tmp = arr[b];
                        arr[b] = arr[b + 1];
                        arr[b + 1] = tmp;
                    }
                }
            }
            return arr;
        }
        var arrMao = arrMao([45, 1, 24, 32, 78, 11, 5]);
        console.log(arrMao); */

        /* function isYeear(year) {
            var flag = false;
            if (year < 1970) {
                alert('请输入大于1970年的年份');
                yuarrun2();
            }
            if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                flag = true;
            }
            return flag;
        }
        function yuarrun2() {
            var res = prompt('输入年份：');
            if (isYeear(res) == true) {
                return '29天';
            } else {
                return '28天';
            }
        }
        console.log(yuarrun2()); */
        /* var isyear = isYeear(prompt('输入年份'));
        if (isyear == true) {
            console.log('闰年');
        } else {
            console.log('平年');
        } */

        /* function fun1() {
            console.log('is Function 1');
            fun2();
        }

        function fun2() {
            console.log('is Function 2');
            fun1();
        }
        fun1(); */
        /* var funn2 = function(res) {
            alert(res);
        }
        funn2('是匿名函数'); */

        /* var num = 10;
        console.log(num);

        function nn() {
            console.log(num);
        }
        nn();

        function n1m() {
            var nm = 100;
        }
        n1m();
        // console.log(nm);

        function n2m() {
            nmn = 10086;
        }
        n2m();
        console.log(nmn); //未声明的变量也是全局变量 */
        /* var nnmmm = 10;

        function fn() {
            var nnmmm = 20;

            function fnn() {
                console.log(nnmmm);
            }
            fnn();
        }
        fn(); */

        //变量预解析(变量提升) var 函数预解析(函数提升) function
        //把变量提升到当前作用域最前面 不赋值
        //把函数提升到当前作用域最前面 不调用函数
        // console.log(res);//报错
        /* console.log(res);//undefined
        var res = 'res' */

        /* fns();//fns
        function fns() {
            console.log('fns');
        }
        fns1();//报错
        var fns1 = function() {
            console.log('fns1');
        } */

        /* var num11 = 11;
        fun11(); //undefined

        function fun11() {
            console.log(num11);
            var num11 = 11;
        }

        function fun12() {
            var a1 = b1 = c1 = 12;
            console.log(a1);
            console.log(b1);
            console.log(c1);
        }
        fun12();
        console.log(a1);
        console.log(b1);
        console.log(c1); */

        /* var shenzi = {
            name: '八重神子',
            age: 15,
            sex: 'girl',
            sayHi: function() {
                console.log(`${this.name}:欧尼酱`);
            },
            prop: '老婆'
        }
        shenzi.sayHi();
        console.log(shenzi.age);
        console.log(shenzi['name']);

        var shenli = new Object();
        shenli.name = '神里凌华';
        shenli.age = 15;
        shenli['sex'] = 'girl';
        shenli['saiHi'] = function() {
            console.log(`${this.name}:欧尼酱`);
        }
        shenli.prop = '老婆';
        console.log(shenli.sex);
        shenli.saiHi();
        //构造函数
        function genShin(name, age, sex, saiHi, prop) {
            this.name = name; //name: string
            this.age = age; //age: number
            this.sex = sex; //sex: string
            this.saiHi = function(saysomething) {
                console.log(`${this.name}:${saysomething}`);
            }; //saiHi: function
            this.prop = prop; //prop: string
        }
        //对象实例化，
        //1.遇到new就在内存中创建空的对象
        //2.让this指向这个对象
        //3.执行构造函数里的方法
        //4.返回对象，所以不需要return关键字
        let keqing = new genShin('刻晴', 16, 'girl', '老婆');
        let hutao = new genShin('胡桃', 16, 'girl', '老婆');
        keqing.saiHi('欧尼酱');
        hutao.saiHi('欧尼酱哟'); */
        /* var shenzi = {
            name: '八重神子',
            age: 15,
            sex: 'girl',
            sayHi: function() {
                console.log(`${this.name}:欧尼酱`);
            },
            prop: '老婆'
        };
        //for in 遍历
        for (var a in shenzi) {
            console.log(a);
            console.log(shenzi[a]);
        } */
        /* console.log(Math.max(1, 2, 5, 7, 24, 487, 'hh'));
        console.log(Math.abs(-125)); //125
        console.log(Math.floor(1.9)); //向下取整 1
        console.log(Math.ceil(1.9)); //向上取整 2 
        console.log(Math.round(1.5) + '  ' + Math.round(-1.5)); //四舍五入 2 -1
        console.log(Math.random()); //随机数 [0,1)
        function getRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }
        console.log(getRandom(0, 100));
        //随机点名
        var arrMyWife = ['八重神子', '胡桃', '神里凌华', '刻晴'];
        console.log(arrMyWife[getRandom(0, arrMyWife.length - 1)]); */

        /* function getRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        }
        while (true) {
            var random = getRandom(1, 10);
            var num = prompt('输入数字，正确则退出' + `\ntips:${random}`);
            if (num == null) {
                break;
            } else if (num == '') {
                alert('你什么都没输入,' + `正确答案为${random}`);
            } else if (num > random) {
                alert('大了,' + ` 正确答案为${random}`);
            } else if (num < random) {
                alert('小了,' + ` 正确答案为${random}`);
            } else {
                alert('对了,' + ` 正确答案为${random}`);
                break;
            }
        } */
        /* function getTimes() {
            var time = new Date();
            var h = time.getHours();
            h = h < 10 ? '0' + h : h;
            var m = time.getMinutes();
            m = m < 10 ? '0' + m : m;
            var s = time.getSeconds();
            s = s < 10 ? '0' + s : s;
            return h + ':' + m + ':' + s;
        }
        var date1 = +new Date();
        console.log(date1);
        console.log(new Date().getTime()); //时间戳,1970.1.1距今的毫秒数
        console.log(new Date().valueOf());
        console.log(Date.now());

        console.log(`${new Date().getFullYear()}年${new Date().getMonth()+1}月${new Date().getDate()}日`);
        console.log(getTimes()); */
        /* function daoJiShi(time) {
            var nowTime = +new Date();
            var inputTime = +new Date(time);
            var theD = inputTime - nowTime;
            console.log(theD);
            var times = theD / 1000; //1s = 1000ms
            console.log(times);
            var d, h, m, s;
            d = parseInt(times / 60 / 60 / 24);
            d = d < 10 ? '0' + d : d;
            h = parseInt(times / 60 / 60 % 24);
            h = h < 10 ? '0' + h : h;
            m = parseInt(times / 60 % 60);
            m = m < 10 ? '0' + m : m;
            s = parseInt(times % 60);
            s = s < 10 ? '0' + s : s;
            return d + '天' + h + '时' + m + '分' + s + '秒';
        }
        var dao = daoJiShi('2022-2-20 18:00:00')
        console.log(dao); */
        /* function reverseArr(arr) {
            // if (arr instanceof Array) {
            if (Array.isArray(arr)) {
                var newArr = [];
                for (var a = arr.length - 1; a >= 0; a--) {
                    newArr[newArr.length] = arr[a];
                }
                return newArr;
            } else {
                return '\n\n\nerror!! \t数组要求[x,x,x,x]格式\n\n\n';
            }

        }
        var res = reverseArr([1, 2, 3]);
        var res1 = reverseArr(1, 2, 3);
        console.log(res);
        console.log(res1);
        console.log(res instanceof Array); //true
        console.log(Array.isArray(res)); //true */
        /* var arr2 = [];
        arr2.push(4, 5, 'A');
        console.log(arr2);
        arr2.unshift(1, 2, 3);
        console.log(arr2);
        arr2.pop();
        console.log(arr2);
        arr2.shift();
        console.log(arr2);
        var arr3 = [1, 5, 18, 27, 9, 3, 4];
        var arrtmp3 = [];
        for (var a = 0; a < arr3.length; a++) {
            if (arr3[a] >= 3) {
                // arrtmp3[arrtmp3.length] = arr3[a];
                arrtmp3.push(arr3[a]);
            }
        }
        console.log(arrtmp3);
        arr3.reverse();
        console.log(arr3); //翻转
        arr3.sort();
        console.log(arr3); //冒泡(第一个数字)
        arr3.sort(function(a, b) {
            return a - b; //升序
            // return b - a;//降序
        });
        console.log(arr3); //冒泡 */
        /* var arr4 = ['A', 'B', 'C', 'D', 'E', 'F', 'C'];
        console.log(arr4.indexOf('C')); //首次出现的位置
        console.log(arr4.lastIndexOf('C')); //最后一次出现的位置 */

        /* function delDou(arr5) {
            var newArr = [];
            for (var a = 0; a < arr5.length; a++) {
                if (newArr.indexOf(arr5[a]) == -1) {
                    newArr.push(arr5[a]);
                }
            }
            return newArr;
        }
        var arr6 = delDou(['刻晴', '八重神子', '神里凌华', '刻晴', '八重神子', '八重神子']);
        var arr9 = ['A', 'B', 'C', 'D', 'E', 'F', 'C'];
        console.log(arr6);
        var new1 = arr6.toString();
        console.log(new1);
        var new2 = arr6.join('|+-+|');
        console.log(new2);
        var arr10 = arr6.concat(arr9);
        console.log(arr10);
        var arr11 = arr10.slice(0, 3); //截取
        console.log(arr11);
        var arr12 = arr10.splice(0, 3); //删除
        console.log(arr12);
        console.log(arr10); */
        //基本包装类型
        /* var str2 = '你好';
        console.log(str2.charAt(0));
        // js会把 基本数据类型 包装成 复杂数据类型
        var str3;
        var temp = new String('你好');
        str3 = temp;
        temp = null;
        console.log(str3.charAt(0)); */
        /* var str = "hello";
        str[1] = "W";
        console.log(str);
        str = "How are you!";
        console.log(str); */
        /* var str13 = 'abcoefoxyozzopp';
        var indexaa = str13.indexOf('o');
        var numaa = 0;
        while (indexaa !== -1) {
            console.log(indexaa);
            indexaa = str13.indexOf('o', indexaa + 1);
            numaa++;
        }
        console.log('出现次数为：' + numaa); */
        /* var str14 = 'abcoefoxyozop';
        for (var a = 0; a < str14.length; a++) {
            console.log(str14.charAt(a));
            console.log('ASCII: ' + str14.charCodeAt(a));
            console.log(str14[a]);
        } */
        /* var objaa = {
            age: 18
        }
        if (objaa['age']) {
            console.log('有该对象');
        } else {
            console.log('没有该对象');
        } */






        //183 184





        /* var str16 = '山高狐狸野';
        console.log(str16.concat('，八重是我姐'));

        var str17 = '神子我老婆';
        console.log(str17.substr(0, 2)); //从第几个开始，取几个字符

        var str18 = '神子我老婆';
        var str19 = 'sfddnjkvhduiyavberdderaghbddgf';

        while (str19.indexOf('d') !== -1) {
            str19 = str19.replace('d', '*')
        }
        console.log(str19);

        console.log(str18.replace('神子', '凌华'));

        var str20 = 'a,b,c';
        console.log(str20.split(','));

        var str21 = 'a&b&c';
        console.log(str21.split('&')); */

        //对象实例放在堆里 。。
    </script>
</body>

</html>